home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 951 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: news.iag.net!news
  2. From: jatmon@iag.net (John R Buchan)
  3. Newsgroups: comp.lang.c,comp.os.os2.programmer.misc
  4. Subject: Re: redefining stdout and stderr
  5. Date: 10 Jan 1996 13:24:27 GMT
  6. Organization: Internet Access Group, Orlando, Florida
  7. Message-ID: <4d0emb$7aq@news.iag.net>
  8. References: <DKw9Cv.2x4@fyi.net> <4ctfij$77o@baloo.pipex-sa.net>
  9. NNTP-Posting-Host: pm1-orl23.iag.net
  10. X-Newsreader: WinVN 0.99.7
  11.  
  12. In article <4ctfij$77o@baloo.pipex-sa.net>, thierry@solo.pipex.co.za says...
  13. >
  14. >In <DKw9Cv.2x4@fyi.net>, fireresq@fyi.net writes:
  15. >>everyting I am doing is running on OS/2 Warp Connect and using the IBM 
  16. >>Set++ compiler.
  17. >>
  18. >>I have a program that I have converted form an exe to a DLL.  I used many
  19. >>printf's for debug and status information.
  20. >>
  21. >>What I want to do is cause stdout and stderr to go to a file but since 
  22. >>this dll will be called from VisualAge I cannot redirect the output with >.
  23. >>
  24. >[...]
  25. >>Thanks in advance!
  26. >>Mark Russell.
  27. >
  28. >Close the handles 1 and 2 (stdout and stderr) then open your file.
  29. >Use DosDupHandle (or the lib equivalent) to get your redirection.
  30.  
  31. Why not just use the ansi reopen function?
  32.  
  33. From the c.l.c faq (Frequently Asked Question) list (available for 
  34. anonymous ftp from rtfm.mit.edu /pub/usenet/comp.lang.c):
  35.  
  36. 12.33:    How can I redirect stdin or stdout to a file from within a
  37.     program?
  38.  
  39. A:    Use freopen() (but see question 12.34 below).
  40.  
  41.  
  42. -- 
  43. John R Buchan           -:|:-     Looking for that elusive FAQ?  ftp to:
  44. jatmon@mail.iag.net     -:|:-     rtfm.mit.edu /pub/usenet-by-group/....
  45.  
  46.